
package com.thor.palmmall.dao.statement.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.api.statement.AStatementPayBillDetail;
import com.thor.palmmall.dao.statement.PStatementPayBillDetail;

/**
 * @author:liyang
 * @time:2017年8月16日 下午12:59:16
 * @since:1.0
 */
public class PStatementPayBillDetailConverter
    implements Converter<AStatementPayBillDetail, PStatementPayBillDetail> {

  public static PStatementPayBillDetailConverter getInstance() {
    if (instance == null)
      instance = new PStatementPayBillDetailConverter();
    return instance;
  }

  private static PStatementPayBillDetailConverter instance;

  private PStatementPayBillDetailConverter() {
  }

  @Override
  public PStatementPayBillDetail convert(AStatementPayBillDetail source) {
    if (source == null) {
      return null;
    }
    PStatementPayBillDetail target = new PStatementPayBillDetail();
    target.inject(source);
    
    target.setUuid(source.getUuid());
    target.setSubject(source.getSubject());
    target.setBeginDate(source.getBeginDate());
    target.setEndDate(source.getEndDate());
    target.setPayTotal(source.getPayTotal());
    target.setPayedTotal(source.getPayedTotal());
    target.setUnpayedTotal(source.getUnpayedTotal());
    target.setAccId(source.getAccId());
    target.setPoundage(source.getPoundage());
    target.setBankCode(source.getBankCode());
    return target;
  }
}
